package com.kexio.enterprise.governance.ratelimit.result;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * 限流结果
 * 
 * @author Kexio
 * @since 1.0.0
 */
public class RateLimitResult {
    private boolean allowed;
    private long availableTokens;
    private long waitTimeMs;
    private long resetTimeMs;
    private String reason;
    private LocalDateTime timestamp;
    private Map<String, Object> metadata;

    public RateLimitResult(boolean allowed) {
        this.allowed = allowed;
        this.timestamp = LocalDateTime.now();
    }

    // Getters and Setters
    public boolean isAllowed() { return allowed; }
    public void setAllowed(boolean allowed) { this.allowed = allowed; }
    
    public long getAvailableTokens() { return availableTokens; }
    public void setAvailableTokens(long availableTokens) { this.availableTokens = availableTokens; }
    
    public long getWaitTimeMs() { return waitTimeMs; }
    public void setWaitTimeMs(long waitTimeMs) { this.waitTimeMs = waitTimeMs; }
    
    public long getResetTimeMs() { return resetTimeMs; }
    public void setResetTimeMs(long resetTimeMs) { this.resetTimeMs = resetTimeMs; }
    
    public String getReason() { return reason; }
    public void setReason(String reason) { this.reason = reason; }
    
    public LocalDateTime getTimestamp() { return timestamp; }
    public void setTimestamp(LocalDateTime timestamp) { this.timestamp = timestamp; }
    
    public Map<String, Object> getMetadata() { return metadata; }
    public void setMetadata(Map<String, Object> metadata) { this.metadata = metadata; }
}
